<template>
  <div class="wscn-http404-container">
    <div class="wscn-http404">
      <div class="pic-404">
        <img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404" />
        <div class="pic-404__child">{{ $route.params.name }}</div>
      </div>
      <div class="bullshit" v-if="$route.params.name == 404">
        <div class="bullshit__oops">您访问的页面找不到了！</div>
        <div class="bullshit__info">请检查您输入的网址是否正确。</div>
        <el-button type="primary" @click="toHomes">返回首页</el-button>
      </div>
      <div class="bullshit" v-if="$route.params.name == 401">
        <div class="bullshit__oops">您没有权限访问当前资源！</div>
        <div class="bullshit__info">请联系管理员。</div>
        <el-button type="primary" @click="toHomes">返回首页</el-button>
      </div>
      <div class="bullshit" v-if="$route.params.name == 500">
        <div class="bullshit__oops">服务器出错啦！</div>
        <div class="bullshit__info">请返回重试。</div>
        <el-button type="primary" @click="toHomes">返回首页</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Page404",
  computed: {
    message() {
      return "没有找到当前页面......";
    }
  },
  methods: {
    toHomes() {
      window.location.href = '/'
    }
  }
};
</script>

<style lang="scss" scoped>
.wscn-http404-container {
  background: #fff;
  width: 100%;
  height: 100%;
}
.wscn-http404 {
  display: flex;
  align-items: flex-end;
  width: 1200px;
  transform: translate(-50%, -50%);
  position: absolute;
  top: 40%;
  left: 50%;
  overflow: hidden;
  .pic-404 {
    position: relative;
    float: left;
    width: 400px;
    overflow: hidden;
    margin-bottom: 12px;
    margin-right: 20px;
    &__parent {
      width: 100%;
    }
    &__child {
      position: absolute;
      opacity: 0;
      color: #d5d7e3;
      font-weight: bold;
      font-size: 120px;
      animation-name: cloudLeft;
      animation-duration: .5s;
      animation-timing-function: linear;
      animation-fill-mode: forwards;
      animation-delay: .3s;
      @keyframes cloudLeft {
        0% {
          top: 0;
          left: 0;
          opacity: 0;
        }
        100% {
          top: 70px;
          left: 119px;
          opacity: 1;
        }
      }
    }
  }
  .bullshit {
    position: relative;
    float: left;
    width: 400px;
    overflow: hidden;
    &__oops {
      font-size: 32px;
      font-weight: bold;
      line-height: 40px;
      opacity: 0;
      margin-bottom: 20px;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-fill-mode: forwards;
      color: #d5d7e3;
    }
    &__info {
      font-size: 14px;
      line-height: 24px;
      color: grey;
      font-weight: bold;
      opacity: 0;
      margin-bottom: 30px;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-delay: 0.1s;
      animation-fill-mode: forwards;
    }
    &__return-home {
      display: block;
      float: left;
      width: 110px;
      height: 36px;
      background: #1482f0;
      border-radius: 100px;
      text-align: center;
      color: #ffffff;
      opacity: 0;
      font-size: 14px;
      line-height: 36px;
      cursor: pointer;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-delay: 0.3s;
      animation-fill-mode: forwards;
    }
    @keyframes slideUp {
      0% {
        transform: translateY(60px);
        opacity: 0;
      }
      100% {
        transform: translateY(0);
        opacity: 1;
      }
    }
  }
}
</style>
